<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html 
	xmlns="http://www.w3.org/1999/xhtml" 
    xmlns:h="http://java.sun.com/jsf/html" 
    xmlns:f="http://java.sun.com/jsf/core" 
    xmlns:ui="http://java.sun.com/jsf/facelets"  
    xmlns:a4j="http://richfaces.org/a4j" 
    xmlns:rich="http://richfaces.org/rich">
	<ui:composition template="/template/base.xhtml">
		<ui:define name="body">
			<rich:panel id="painel">
				<f:facet name="header">
					<h:outputText value="#{msg['usuario']}" />
				</f:facet>
				<h:form>
					<h:panelGrid columns="2">
						
						<h:outputText value="#{msg['usuario.id']}" rendered="#{usuarioController.bean.id != null}" />
						<h:outputText value="#{usuarioController.bean.id}" rendered="#{usuarioController.bean.id != null}" />
						
						<h:outputText value="#{msg['usuario.nome']}" />
						<h:inputText value="#{usuarioController.bean.nome}" />
						
						<h:outputText value="#{msg['usuario.login']}" />
						<h:inputText value="#{usuarioController.bean.login}" />
						
						<h:outputText value="#{msg['usuario.senha']}" />
						<h:inputText value="#{usuarioController.bean.senha}" />
						
						<h:outputText value="#{msg['usuario.confirmaSenha']}" />
						<h:inputText value="#{usuarioController.confirmaSenha}" />
						
						<h:outputText value="#{msg['tipoDeUsuario']}" />
						<h:selectOneMenu value="#{usuarioController.bean.tipoDeUsuario.id}">
							<f:selectItems value="#{comboController.tiposDeUsuario}" />
						</h:selectOneMenu>
						
						<h:commandButton action="#{usuarioController.save}" value="#{msg['salvar']}" />
						<h:commandButton action="#{usuarioController.delete}" value="#{msg['deletar']}" rendered="#{usuarioController.bean.id != null}" />
						<h:commandButton action="#{usuarioController.backToSummary}" value="#{msg['voltar']}" />
						
					</h:panelGrid>
				</h:form>
			</rich:panel>
		</ui:define>
	</ui:composition>
</html>